package com.zjs.utils;


import com.zjs.dao.entity.SysUser;
/**
 * 本地线程工具
 */

public class UserThreadLocal {

    private UserThreadLocal(){}
    //线程变量隔离
    private static final ThreadLocal<SysUser> LOCAL = new ThreadLocal<>();

    /**
     * 放
     * @param sysUser
     */
    public static void put(SysUser sysUser){
        LOCAL.set(sysUser);
    }

    /**
     * 取
     * @return
     */
    public static SysUser get(){
        return LOCAL.get();
    }

    /**
     * 删除
     */
    public static void remove(){
        LOCAL.remove();
    }
}
